package com.zlsoft.sbsm.test;

import java.util.Arrays;

public class HiArrays {
    public static void main(String[] args) {
        int[] a = {11,2,5,3,343,56,43,45454};
        System.out.println("数组整体输出");
        System.out.println(Arrays.toString(a));
        System.out.println("排序：");
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        int x=43;
        System.out.println("二分查找：");
        System.out.println(x+" in array index: "+Arrays.binarySearch(a,x));
        x=77;
        System.out.println(x+" in array index: "+Arrays.binarySearch(a,x));

        double[] b = new double[9];
        Arrays.fill(b, 9.9);
        System.out.println("填充数组："+Arrays.toString(b));

    }
}
